<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2020/11/8
  Time: 20:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>top</title>
</head>
<script src="/WebContent/JQuery/jquery-3.4.1.js" type="text/javascript"></script>
<style type="text/css">
    body{
        width: 100%;
        height: 150px;
        box-sizing: border-box;
    }
    .cont{
        width: 250px;
        height: 130px;
        margin: 0 auto;
        font-size: 50px;
        font-weight: 700;
        line-height: 150px;
        padding-left: 30px;
        color: #fff;
    }
    .welcome,.goback{
        height: 30px;
        line-height: 30px;
        margin-bottom: 10px;
        color: #fff;
    }
    .welcome{
        text-align: end;
        margin-right: 5px;
    }
    .goback{
        text-align: end;
        margin-right: 45px;
    }
    a{
        text-decoration: none;
        color: #fff;
    }
    a:hover{
        color: red;
    }
</style>
<body>
     <div class="cont">
          管理员
     </div>
    <div class="welcome">
        你好，管理员、服务包您满意！
    </div>
    <div class="goback">
        <a href="javascript:void(0);" id="tc">退出系统&gt;&gt;</a>
    </div>
<script>
    $(document).ready(function () {
        $("#tc").click(function () {
            if(confirm("确认注销系统吗？")){
                $.ajax({
                    url:"/AdminLoginServlet",
                    type:"get",
                    data:{"type":"tc"},
                    datatype:"text",
                    success:function (data) {
                        if(data == "1"){
                            window.alert("注销成功！");
                            parent.location.href = "/WebContent/HTML/AdminLogin.jsp";
                        }else if(data == "0"){
                            window.alert("操作失败，请重新尝试！");
                        }
                    },
                    error:function (error) {
                         alert("系统繁忙，请稍后再试！");
                    }
                })
            }

        })
    })
</script>
</body>
</html>